class DisruptorFire extends TFProjectileFire;	//LinkAltFire;

var sound LinkedFireSound;
var string LinkedFireForce;  // jdf

function DrawMuzzleFlash(Canvas Canvas)
{
    if (FlashEmitter != None)
    {
        FlashEmitter.SetRotation(Weapon(Owner).Rotation);
        Super.DrawMuzzleFlash(Canvas);
    }
}

event ModeDoFire()
{
    Recoil();
    Super.ModeDoFire();
}

function Projectile SpawnProjectile(Vector Start, Rotator Dir)
{
    local DisruptorProjectile Proj;

    Start += Vector(Dir) * 10.0;
    Proj = Spawn(class'DisruptorProjectile',,, Start, Dir);
//    if ( Proj != None )
//    {
//		Proj.Links = 1;
//		Proj.LinkAdjust();
//	}
//    Recoil();

    return Proj;
}

function FlashMuzzleFlash()
{
    if (FlashEmitter != None)
    {
//FinalBlend'TFMedia.Plasma_Muz_blueFB';
FlashEmitter.Skins[0] = FinalBlend'XGameShaders.WeaponShaders.FlakFlashFinal';
    }
    Super.FlashMuzzleFlash();
}

function ServerPlayFiring()
{
        FireSound = default.FireSound;
    Super.ServerPlayFiring();
}

function PlayFiring()
{
        FireSound = default.FireSound;
    Super.PlayFiring();
}

simulated function ModeTick(float dt)
{
if (FlashEmitter != None)
    {
//    FlashEmitter.Skins[0] = FinalBlend'TFMedia.PlasmaMuzProjBlueFB';
    }
}

function Recoil()
{
    local Rotator NewRotation;
    local float NewPitch, NewYaw;

    if ( (Instigator != None) && Instigator.IsFirstPerson()){
    NewPitch = int(Frand()*150); NewYaw = int(Frand()*250);
    if (Frand() > 0.5) NewYaw *= -1;
    if (Frand() > 0.5) NewPitch *= -1;
    NewRotation = Instigator.GetViewRotation();
    NewRotation.Pitch += NewPitch;
    NewRotation.Yaw += NewYaw;
    Instigator.SetViewRotation(NewRotation);}
}

defaultproperties
{
     ProjSpawnOffset=(X=25.000000,Y=10.000000,Z=-5.000000)
     FireSound=Sound'TFMedia.DisruptorFire'
     FireRate=1.500000
     AmmoClass=Class'Taskforces.DisruptorAmmo'
     AmmoPerFire=10
     ShakeRotTime=2.000000
     ShakeOffsetMag=(X=-20.000000)
     ShakeOffsetRate=(X=-1000.000000)
     ShakeOffsetTime=2.000000
     ProjectileClass=Class'Taskforces.DisruptorProjectile'
     BotRefireRate=2.000000
}
